# -*- encoding=utf-8 -*-

import os
import time
import json


class Timer:
    """计时器
    """

    def __init__(self):
        self.val = time.time()

    def tick(self):
        return round(time.time() - self.val, 6)


def urllist():
    """
    加载图片链接
    """
    list_file = os.path.join('resource/mp3.json')
    with open(list_file, 'r', encoding='UTF-8') as f:
        url_list = [line.strip() for line in f]
    mp3s = json.loads(''.join(url_list))
    return ['http://www.snhm.org.cn/museum/' + mp3['audio'] for mp3 in mp3s]
